package com.zhou.gof.group.abstractfactory.producer;

import com.zhou.gof.group.abstractfactory.abstractfactory.AnimalAbstractFactory;
import com.zhou.gof.group.abstractfactory.factory.MammalFactory;
import com.zhou.gof.group.abstractfactory.factory.ReptileFactory;

/**
 * @author zhoudong
 * @title: AnimalProducer
 * @projectName user-app
 * @description: TODO
 * @date 2019/5/29 13:59
 */
public class AnimalProducer {
    public static AnimalAbstractFactory getFactory(String type){
        switch (type){
            case "mammal":
                return new MammalFactory();
            case "reptile":
                return new ReptileFactory();
            default:
                return new ReptileFactory();
        }
    }
}
